<template>
  <div class="app-container">
    <el-table
      v-loading="listLoading"
      :data="list"
      :border="false"
      fit
      style="width: 100%;"
    >
      <el-table-column label="ID" width="80">
        <template slot-scope="{row}">
          <span>{{ row.id }}</span>
        </template>
      </el-table-column>
      <el-table-column label="等级" width="100">
        <template slot-scope="{row}">
          <span>{{ row.name }}</span>
        </template>
      </el-table-column>
      <el-table-column label="门槛">
        <template slot-scope="{row}">
          <span>{{ +row.amount }}</span>
        </template>
      </el-table-column>
      <el-table-column label="分红比率">
        <template slot-scope="{row}">
          <span>{{ +row.ratio }}%</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import waves from '@/directive/waves'
import api from '@/api'

export default {
  name: 'GroupLevel',
  directives: { waves },
  data() {
    return {
      listLoading: false,
      list: []
    }
  },
  created() {
  },
  mounted() {
    this.getList()
  },
  methods: {
    /**
     * 获取数据列表
     */
    getList() {
      this.listLoading = true
      api.marketing.groupLevel().then(response => {
        const { data } = response
        this.list = data
      }).finally(() => {
        this.listLoading = false
      })
    }
  }
}
</script>
